﻿<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
    x:Class="Hangout.Client.App"
    >

    <!--Application Resources-->
    <Application.Resources>
    	<Style x:Key="ToggleSwitchTemplate" TargetType="toolkit:ToggleSwitch">
    		<Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}"/>
    		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}"/>
    		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
    		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="IsTabStop" Value="False"/>
    		<Setter Property="HorizontalContentAlignment" Value="Left"/>
    		<Setter Property="SwitchForeground" Value="{StaticResource PhoneAccentBrush}"/>
    		<Setter Property="VerticalContentAlignment" Value="Top"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="toolkit:ToggleSwitch">
    					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CacheMode="BitmapCache" Padding="{TemplateBinding Padding}">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="Disabled"/>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Grid Margin="12,0,0,8" HorizontalAlignment="Left" Width="166" Height="98" VerticalAlignment="Bottom">
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="*"/>
    								<ColumnDefinition Width="Auto"/>
    							</Grid.ColumnDefinitions>
    							<Grid.RowDefinitions>
    								<RowDefinition Height="Auto"/>
    								<RowDefinition Height="Auto"/>
    							</Grid.RowDefinitions>
    							<toolkitPrimitives:ToggleSwitchButton x:Name="Switch" Background="{TemplateBinding Background}" Margin="0,0,0,-98" Opacity="{TemplateBinding Opacity}" SwitchForeground="{TemplateBinding SwitchForeground}" VerticalAlignment="Bottom" Grid.Row="1" d:LayoutOverrides="VerticalAlignment" Height="98"/>
    						</Grid>
    					</Border>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<SolidColorBrush x:Key="YellowBrush" Color="#FFFFAF04"/>
    	<SolidColorBrush x:Key="BlueBrush" Color="#FF000C1B"/>
    	<Color x:Key="AppbarColor">#FF15202D</Color>
    	<Style x:Key="PhoneButtonBase" TargetType="ButtonBase">
    		<Setter Property="Background" Value="Transparent"/>
    		<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
    		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
    		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
    		<Setter Property="Padding" Value="10,3,10,5"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="ButtonBase">
    					<Grid Background="Transparent">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Pressed">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
    							<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
    						</Border>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="PhoneRadioButtonCheckBoxBase" BasedOn="{StaticResource PhoneButtonBase}" TargetType="ToggleButton">
    		<Setter Property="Background" Value="{StaticResource PhoneRadioCheckBoxBrush}"/>
    		<Setter Property="BorderBrush" Value="{StaticResource PhoneRadioCheckBoxBrush}"/>
    		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
    		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
    		<Setter Property="HorizontalContentAlignment" Value="Left"/>
    		<Setter Property="VerticalContentAlignment" Value="Center"/>
    		<Setter Property="Padding" Value="0"/>
    	</Style>
    	<Style x:Key="CheckBoxTemplate" BasedOn="{StaticResource PhoneRadioButtonCheckBoxBase}" TargetType="CheckBox">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="CheckBox">
    					<Grid Background="Transparent">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Pressed">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="IndeterminateMark">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneRadioCheckBoxCheckBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="IndeterminateMark">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneRadioCheckBoxCheckDisabledBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="CheckStates">
    								<VisualState x:Name="Checked">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CheckMark">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Unchecked"/>
    								<VisualState x:Name="Indeterminate">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateMark">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Grid Margin="{StaticResource PhoneTouchTargetLargeOverhang}">
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="32"/>
    								<ColumnDefinition Width="*"/>
    							</Grid.ColumnDefinitions>
    							<Border x:Name="CheckBackground" BorderBrush="#FFC88800" BorderThickness="{StaticResource PhoneBorderThickness}" Background="{StaticResource YellowBrush}" HorizontalAlignment="Left" Height="32" IsHitTestVisible="False" VerticalAlignment="Center" Width="32"/>
    							<Rectangle x:Name="IndeterminateMark" Fill="{StaticResource PhoneRadioCheckBoxCheckBrush}" HorizontalAlignment="Center" Height="16" IsHitTestVisible="False" Grid.Row="0" Visibility="Collapsed" VerticalAlignment="Center" Width="16"/>
    							<Path x:Name="CheckMark" Data="M0,119 L31,92 L119,185 L267,0 L300,24 L122,250 z" Fill="{StaticResource BlueBrush}" HorizontalAlignment="Center" Height="18" IsHitTestVisible="False" Stretch="Fill" StrokeThickness="2" StrokeLineJoin="Round" Visibility="Collapsed" VerticalAlignment="Center" Width="24"/>
    							<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="12,0,0,0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
    						</Grid>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<SolidColorBrush x:Key="WhiteBrush" Color="#FFEAEAEA"/>



    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
    	<shell:PhoneApplicationService 
    		Launching="Application_Launching" Closing="Application_Closing" 
    		Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>